import { request } from '@/utils/request';
import CRUD from '@/utils/request/CRUD';

// 预算项目CRUD
export const budgetProjectCRUD = CRUD('/decoration/budget-project');

// 材料分析
export function materialAnalysis(params: Record<string, any>) {
  return request.get({
    url: '/decoration/budget-material/analysis',
    params,
  });
}

// 人工费用分析
export function laborCostsAnalysis(params: Record<string, any>) {
  return request.get({
    url: '/decoration/budget-labor-costs/analysis',
    params,
  });
}

// 复制方案
export function copyProgramme(data: Record<string, any>) {
  return request.post({
    url: '/decoration/budget-project/copy-programme',
    data,
  });
}

// 导出预算项目
export function exportBudgetProject(params: Record<string, any>) {
  return request.get(
    {
      url: '/decoration/budget-project/export-tree-excel',
      params,
      responseType: 'blob',
    },
    {
      isTransformResponse: false,
    },
  );
}
